package io.aicn.lowcode.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;

@Schema(description = "Product creation request")
public class ProductCreate {
    
    @NotBlank(message = "Product name is required")
    @Size(max = 100, message = "Product name must be less than 100 characters")
    @Schema(description = "Product name", example = "iPhone 15")
    private String name;
    
    @NotBlank(message = "Product code is required")
    @Size(max = 50, message = "Product code must be less than 50 characters")
    @Schema(description = "Product code", example = "IP15")
    private String code;
    
    @Size(max = 500, message = "Description must be less than 500 characters")
    @Schema(description = "Product description", example = "Apple iPhone 15 128GB")
    private String description;
    
    @NotNull(message = "Price is required")
    @DecimalMin(value = "0.01", message = "Price must be greater than 0")
    @Schema(description = "Product price", example = "5999.00")
    private BigDecimal price;
    
    @Size(max = 50, message = "Category must be less than 50 characters")
    @Schema(description = "Product category", example = "手机")
    private String category;
    
    @NotNull(message = "Stock is required")
    @Min(value = 0, message = "Stock must be non-negative")
    @Schema(description = "Product stock", example = "100")
    private Integer stock;
    
    @NotBlank(message = "Status is required")
    @Size(max = 20, message = "Status must be less than 20 characters")
    @Schema(description = "Product status", example = "ACTIVE")
    private String status;

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public String getCategory() {
        return category;
    }

    public Integer getStock() {
        return stock;
    }

    public String getStatus() {
        return status;
    }
}